package view.code
{
	import com.adobe.cairngorm.control.CairngormEventDispatcher;
	
	import flash.events.MouseEvent;
	
	import mvc.control.CharacterEvent;
	
	import mx.containers.VBox;
	import mx.controls.Button;
	import mx.controls.TextArea;

	public class CodeConfirm extends VBox
	{
		public var txtInformation:TextArea;
		public var btnYes:Button;
		public var btnNo:Button;

		public function CodeConfirm()
		{
			super();
		}

		private var _information:String;
		private var _source:Object;

		public function set information(data:String):void
		{
			_information = data;

			this.txtInformation.text = _information;
		}

		public function set source(data:Object):void
		{
			_source = data;
		}

		protected function btnYes_clickHandler(event:MouseEvent):void
		{
			var mvcEvent:CharacterEvent = new CharacterEvent(CharacterEvent.REMOVE_CHARACTER_YES);
			mvcEvent.data = {popUp: this, dsnCharacter: _source};
			CairngormEventDispatcher.getInstance().dispatchEvent(mvcEvent);
		}

		protected function btnNo_clickHandler(event:MouseEvent):void
		{
			var mvcEvent:CharacterEvent = new CharacterEvent(CharacterEvent.REMOVE_CHARACTER_NO);
			mvcEvent.data = {popUp: this};
			CairngormEventDispatcher.getInstance().dispatchEvent(mvcEvent);
		}
	}
}